package com.adxon.servlet;

import com.adxon.MsgException;
import com.adxon.data.Item;

import java.io.IOException;
import java.util.StringTokenizer;

import javax.servlet.ServletException;
import javax.servlet.http.*;

@SuppressWarnings("serial")
public class InfoServlet extends ServletBase{
	public void doGet(HttpServletRequest req,HttpServletResponse resp)
			throws IOException,ServletException{
		try{
			String p=req.getPathInfo();
			System.out.println("InfoServlet: "+p);
			if(p!=null){
				if(p.length()>1){
					p=p.substring(1).trim();
					setAttributes(req,"Info");
					((Item)new Item().update(new StringTokenizer(p,"."))).
						extend().getInfo(req);
					forward(req,resp);
				}
			}else{
				// TODO:...
			}
		}catch(MsgException e){
			e.routing(req,resp);
		}
	}
}